package com.haoniu.module.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.haoniu.module.mapper.RoomUserMapper;
import com.haoniu.module.domain.database.RoomUser;
import com.haoniu.module.service.RoomUserService;
import com.haoniu.common.support.Convert;

import javax.annotation.Resource;

/**
 * 房间用户关联 服务层实现
 * 
 * @author houyijun
 * @date 2019-01-24
 */
@Service
public class RoomUserServiceImpl implements RoomUserService
{
	@Resource
	private RoomUserMapper roomUserMapper;

	/**
     * 查询房间用户关联信息
     * 
     * @param id 房间用户关联ID
     * @return 房间用户关联信息
     */
    @Override
	public RoomUser selectRoomUserById(Integer id) {
	    return roomUserMapper.selectRoomUserById(id);
	}
	
	/**
     * 查询房间用户关联列表
     * 
     * @param roomUser 房间用户关联信息
     * @return 房间用户关联集合
     */
	@Override
	public List<RoomUser> selectRoomUserList(RoomUser roomUser) {
	    return roomUserMapper.selectRoomUserList(roomUser);
	}
	
    /**
     * 新增房间用户关联
     * 
     * @param roomUser 房间用户关联信息
     * @return 结果
     */
	@Override
	public int insertRoomUser(RoomUser roomUser) {
	    return roomUserMapper.insertRoomUser(roomUser);
	}
	
	/**
     * 修改房间用户关联
     * 
     * @param roomUser 房间用户关联信息
     * @return 结果
     */
	@Override
	public int updateRoomUser(RoomUser roomUser) {
	    return roomUserMapper.updateRoomUser(roomUser);
	}

	/**
     * 删除房间用户关联对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteRoomUserByIds(String ids) {
		return roomUserMapper.deleteRoomUserByIds(Convert.toStrArray(ids));
	}

	@Override
	public int deleteRoomUserById(Integer id) {
		return roomUserMapper.deleteRoomUserById(id);
	}

	@Override
	public RoomUser getUser(Integer userId,Integer roomId) {
		return roomUserMapper.getUser(userId,roomId);
	}

}
